package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.qo.EmployeeQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    List<Employee> selectByQuery(EmployeeQueryObject queryObject);

    int countByQuery(EmployeeQueryObject queryObject);

    void insertRelationEmployeeAndRole(@Param("employeeId")Long employeeId, @Param("roleId")Long roleId);

    void deleteRelationEmployeeAndRole(Long id);

    Employee getEmployeeByNameAndPassword(@Param("name") String name, @Param("password") String password);

    void deleteRelationEmployeeAndRoleByRoleId(Long roleId);

    void batchDelete(@Param("ids") Long[] ids);

    void batchDeleteRelation(@Param("ids")Long[] ids);

    Employee getEmployeeByName(String toString);

    List<Employee> queryByRoleSn(@Param("roleSns") String[] roleSns);

}